<?php
// +----------------------------------------------------------------------
// | 跃飞 [ 将来的你一定会感激现在奋斗的自己 ]
// +----------------------------------------------------------------------
// | Author: 钟贵廷
// +----------------------------------------------------------------------
// | Author URI: https://git.oschina.net/yeafy
// +----------------------------------------------------------------------
// | weChat:gt845272922  qq:845272922
// +----------------------------------------------------------------------

namespace app\yeafy\simpleFactory\demo2;


class PizzaFactory
{
    public static function getInstance($type)
    {
        $obj = null;
        if($type == 'US')
        {
            echo "工厂开始生产USPizza<br/>";
            $obj = new USPizza();

        }
        elseif($type == 'CN')
        {
            echo "工厂开始生产ChinesePizza<br/>";
            $obj = new ChinesePizza();
        }
        else
        {
            echo "此工厂无法生产此类Pizza<br/>";
        }
        return $obj;
    }
    
}